var EP=require('eventproxy');
var mock=require('./mock.js');

var ep=EP.create('get','read','query',(get,read,query)=>{
    console.log(get,read,query);
});
ep.fail((err)=>{
    console.error('EP ERROR:',err);
});

mock.get(0,ep.done('get'));
mock.read(0,ep.done('read'));
mock.query(0,(err,query)=>{
    if(err)return ep.throw(err);
    ep.emit('query',query);
});

